﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HuaHan.WorkTicket.DataObjects
{
    public class DepartmentDTO:BaseDTO
    {
        //[Required]
        [DisplayName("部门名称")]
        public string Name
        {
            get;
            set;
        }



        [DisplayName("描述")]
        public string Description
        {
            get;
            set;
        }

        public Guid ParentID { get; set; }

        [DisplayName("部门电话")]
        public string Phone { get; set; }

        [DisplayName("顶级组织")]
        public bool IsTop { get; set; }


        public int SortOrder { get; set; }

        public bool HasChildDepartment
        {
            get
            {
                if (this.ChildDepartmentList != null && this.ChildDepartmentList.Count() > 0)
                {
                    return true;
                }
                else
                {
                    return false;
                }
            }
        }

        public List<DepartmentDTO> ChildDepartmentList
        {
            get;
            set;
        }

        public string ParentDepartmentName { get; set; }
    }
}
